<template>
	<view>
		<pageheader :setting="settingdata"></pageheader>
		<view class="logobox">
			<u-toast ref="uToast"></u-toast>
			<image :src="shopInfo.image" mode="aspectFill"></image>
		</view>
		<view class="basicinfo">
			<text class="title">基础信息</text>
			<view class="infoline">
				<text class="infoname">苗店名称/昵称</text>
				<view class="lineputs">{{shopInfo.shop_name}}</view>
			</view>
			<view class="infoline">
				<text class="infoname">微信号</text>
				<view class="lineputs">{{shopInfo.wechat}}</view>
			</view>
			<view class="infoline">
				<text class="infoname">手机号</text>
				<view class="lineputs" @click="dialing">{{shopInfo.mobile}}
				</view>
			</view>
			<view class="infoline">
				<text class="infoname">邮箱</text>
				<view class="lineputs">{{shopInfo.email}}</view>
			</view>
			<view class="infoline">
				<text class="infoname">地区</text>
				<view class="lineputs">{{shopInfo.province}}{{shopInfo.city}}{{shopInfo.county}}</view>
			</view>
			<view class="infoline">
				<text class="infoname">详细地址</text>
				<view class="lineputs">{{shopInfo.address}}</view>
			</view>
			<view class="infoline" style="border: none;">
				<text class="infoname">门店</text>
				<view class="lineputs">{{shopInfo.companyname}}</view>
			</view>

			<view class="infoline" style="border: none;">
				<text class="infoname">开始营业时间</text>
				<view class="lineputs">{{shopInfo.starttime==null?'未设置':shopInfo.starttime}}</view>
			</view>
			<view class="infoline" style="border: none;">
				<text class="infoname">结束营业时间</text>
				<view class="lineputs">{{shopInfo.endtime==null?'未设置':shopInfo.endtime}}</view>
			</view>

		</view>
		<view class="basicinfo" style="border: none;">
			<view class="shopstrueone">
				<text class="title">实力简介</text>
				<view class="shopvalue">{{storestrength.describe}}</view>
			</view>
			<view class="shopstrueone">
				<text class="title">主营范围</text>
				<view class="shopvalue">{{storestrength.business}}</view>
				<view class="shopimgbox">
					<block v-for="(item,index) in storestrength.main_images" :key="index">
						<image :src="item" @click="$plug.showImg(storestrength.main_images,item)" mode="aspectFill">
						</image>
					</block>
				</view>
			</view>
			<view class="shopstrueone">
				<text class="title">资质</text>
				<view class="shopimgbox">
					<block v-for="(item,index) in storestrength.enterprise_images" :key="index">
						<image :src="item" @click="$plug.showImg(storestrength.enterprise_images,item)"
							mode="aspectFill"></image>
					</block>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	var _this, shak;
	export default {
		data() {
			return {
				settingdata: {
					name: '苗店信息',
					bgColor: '#fff',
					titleColor: '#000000',
					showNav: true,
					showTypes: 0,
					position: "editstation"
				},
				shopInfo: {},
				storestrength: {}
			}
		},
		onLoad(options) {
			_this = this
			console.log(options)
			if (options.other_uid) {
				_this.other_uid = options.other_uid
			}

			_this.getmessage()
			_this.getstorestrength()
		},
		onShow() {

		},
		methods: {
			// 获取苗店信息
			getmessage() {
				let join = {}
				if (_this.other_uid) {
					join.other_uid = _this.other_uid
				}
				_this.$api.get("myshop", join).then(data => {
					_this.shopInfo = data
					console.log(data)
					// _this.settingdata.name = data.shop_name
				});
			},

			//苗店实力
			getstorestrength() {
				let join = {}
				if (_this.other_uid) {
					join.other_uid = _this.other_uid
				}
				_this.$api.get("storestrength", join).then(data => {
					_this.storestrength = data
				});
			},

			//拨号并记录
			dialing() {
				_this.$plug.dialing(_this.shopInfo.mobile)
			},

			// 防抖点击
			click_shake(fn) {
				if (!_this.shake) {
					fn && typeof fn === 'function' && fn()
					_this.shake = true
					setTimeout(function() {
						_this.shake = false
					}, 500)
				}
			},

		}
	}
</script>

<style lang="scss" scoped>
	.logobox {
		height: 308rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		border-bottom: 22rpx solid #F6F6F6;

		image {
			width: 114rpx;
			height: 114rpx;
			border-radius: 50%;
		}
	}

	.basicinfo {
		padding: 0 28rpx;
		border-bottom: 18rpx solid #f6f6f6;
		display: flex;
		flex-direction: column;

		.title {
			margin-top: 40rpx;
			color: #000000;
			font-size: 32rpx;
			font-weight: bold;
		}

		.infoline {
			padding: 20rpx 0;
			display: flex;
			flex-direction: row;
			align-items: center;
			justify-content: space-between;
			border-bottom: 2rpx solid #f6f6f6;

			.infoname {
				min-width: 230rpx;
				color: #000000;
				font-size: 28rpx;
			}

			.lineputs {
				color: #6b6b6b;
				font-size: 28rpx;
			}
		}
	}

	.shopstrueone {
		padding-bottom: 48rpx;
		border-bottom: 2rpx solid #f6f6f6;
		display: flex;
		flex-direction: column;
		width: 100%;

		.title {
			color: #000;
			font-size: 28rpx;
			font-weight: bold;
		}

		.shopvalue {
			margin-top: 25rpx;
			font-size: 24rpx;
			line-height: 45rpx;
		}

		.shopimgbox {
			margin-top: 28rpx;
			width: 100%;

			image {
				width: 200rpx;
				height: 200rpx;
				border-radius: 10rpx;
				margin-left: 10rpx;
				display: inline-block;
			}
		}
	}
</style>
